package extend;

public class Animal {

    private String name;
    private String color;
    private String _type;

    public Animal(String MyName, String MyColor, String MyType) {
        name = MyName;
        color = MyColor;
        _type = MyType;
    }

    public void eat() {
        System.out.println(color + "的" + _type + "名字为" + name + "正在吃东西！");
    }

    public void run() {
        System.out.println(color + "的" + _type + "名字为" + name + "正在快速奔跑！");
    }

    public void sleep() {
        System.out.println(color + "的" + _type + "名字为" + name + "正在呼呼大睡！");
    }

    public void speak() {
        System.out.println("大家好，我是" + name + "我是一只" + color + "色的" + _type);
    }

    public static void main(String[] args) {
        Animal ani = new Animal("凯迪", "蓝色", "猫");
        ani.speak();
        ani.eat();
        ani.run();
        ani.sleep();
    }

}
